import Person from './person';
class Student extends Person{
    constructor(_id,_name,_age,_klass){
        super(_id,_name,_age);
        this.klass = _klass ;
    }
    introduce(){
        if(!this.klass.leader){//如果不存在班长
            return super.introduce() + ` I am a Student. I am at Class ${this.klass.number}.`;
        }else if(this.id === this.klass.leader.id){
            return super.introduce() + ` I am a Student. I am Leader of Class ${this.klass.number}.`;
        }else{
            return super.introduce() + ` I am a Student. I am at Class ${this.klass.number}.`;
        }
    }  
}
module.exports = Student ;
